OUTPUT TO c:\qadguicli\wiredif.xls.

DEFINE BUFFER s500 FOR sct_det .
DEFINE BUFFER s530 FOR sct_det .
DEFINE BUFFER std FOR sct_det .
DEFINE VARIABLE part AS CHARACTER FORMAT "X(15)".

FOR EACH s500 NO-LOCK WHERE s500.sct_sim = "standard" AND s500.sct_site = "500",
    EACH s530 NO-LOCK WHERE s530.sct_sim = "standard" AND s530.sct_site = "530" 
                AND s500.sct_part = s530.sct_part, /* AND s500.sct_part BEGINS "243-1690013",*/
    EACH pt_mstr NO-LOCK WHERE pt_part = s500.sct_part AND pt_pm_code = "M" AND pt_prod_line = "164": 

    part = REPLACE(s500.sct_part, "H", "").

    FIND FIRST std NO-LOCK WHERE std.sct_part = part AND std.sct_sim = "standard" AND std.sct_site = "500" NO-ERROR.

    DISP s500.sct_part 
         s500.sct_cst_tot LABEL "500STD"
         std.sct_cst_tot  LABEL "BuySTD" WHEN AVAILABLE (std)
         s530.sct_cst_tot LABEL "530STD"
         s530.sct_mtl_ll LABEL "530MTL"
         s530.sct_lbr_tl LABEL "530LBR"
         s530.sct_bdn_tl LABEL "530BDN"
         pt_desc1  LABEL "Desc"
     WITH STREAM-IO WITH WIDTH 200.

END.



